local PROMO_COST = 20000

function onSay(cid, words, param, channel)
	local integer vocation = getPlayerVocation(cid)
	if(vocation >= 1) or (vocation <= 4) then
		if isPremium(cid) then
			if getPlayerMoney(cid) >= PROMO_COST then
				doPlayerRemoveMoney(cid, PROMO_COST)
				vocation = (vocation + 4)
				doPlayerSetVocation(cid, vocation)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been promoted.")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You did not afford to be promoted. (" .. PROMO_COST .. " gp)")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need a premium account to be promoted.")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You are already promoted.")
	end
	return false
end

local function getPlayerMoney(cid)
	return ((getPlayerItemCount(cid, 2160) * 10000) +
	(getPlayerItemCount(cid, 2152) * 100) +
	getPlayerItemCount(cid, 2148))
end
